package demo16;
import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * @author Huangjin
 * @version 1.0
 * describe:
 * @date 2023/3/8 17:40
 */
public class OOSDemo {
    public static void main(String[] args) throws IOException {
        String name = "张三";
        int age = 25;
        String gender = "男";
        String[] otherInfo = {"是一个好人"+"宇宙银河系的"+"喜欢星际旅行"+"喜欢蓝星"};
        Student zs = new Student(name,age,gender,otherInfo);
        System.out.println(zs);

        FileOutputStream fos = new FileOutputStream("student.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(zs);
        System.out.println("写出完毕！");
        fos.close();
    }
}
